<?php

// 判断魔术引号配置状态
if(get_magic_quotes_gpc()){
    function _stripslashes_rcurs($variable, $top=true){
        $clean_data = array();
        foreach ($variable as $key=>$value){
            $key = ($top)? $key : stripslashes($key);
            $clean_data[$key] = (is_array($value)) ?
            stripslashes_rcurs($value, false) : stripslashes($value);
        }
        return $clean_data;
    }
    
    $_GET = _stripslashes_rcurs($_GET);
    $_POST = _stripslashes_rcurs($_POST);
}
?>